package cn.stronglink.assetmanage.business.repair.order;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import cn.stronglink.assetmanage.business.check.checkorder.CheckedFragment;
import cn.stronglink.assetmanage.business.check.checkorder.UnCheckFragment;

/**
 * Author by chencongcong,Date on 2018/9/19
 */
public class RepairViewPagerAdapter extends FragmentPagerAdapter {
    private String[] titles;

    public RepairViewPagerAdapter(FragmentManager fm, String[] titles) {
        super(fm);
        this.titles = titles;
    }

    @Override
    public Fragment getItem(int position) {
        Fragment fragment = null;
        switch (position) {
            case 0:
                fragment = new UnRepairFragment();
                break;
            case 1:
                fragment = new RepairedFragment();
                break;
            default:
                break;
        }
        return fragment;
    }

    @Override
    public int getCount() {
        return titles == null ? 0 : titles.length;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return titles[position];
    }
}
